<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>
<head>
<meta name="decorator" content="sysDefault"/> 
<link
	href="${staticPath}/lib/datetimepicker/0.0.11/css/bootstrap-datetimepicker.min.css"
	rel="stylesheet" type="text/css">
<link href="${staticPath}/lib/chosen/1.1.0/chosen.min.css"
	rel="stylesheet" type="text/css">
<link rel="stylesheet"
	href="${staticPath}/lib/ztree/3.5/css/zTreeStyle/zTreeStyle.css"
	type="text/css">
<script src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.all-3.5.js"
	type="text/javascript"></script>
<script src="${staticPath}/js/jquery-dialog.js" type="text/javascript"></script>
<script type="text/javascript">

   	$(document).ready(
			function() {
				var opt = {
					service : "selectOneFloorService",
					idField : "floorid",
					nameField : "floorName",
					title : "门店选择对话框"
				};
				$("#floorDialog").Dialog(opt);
				
				

				$("#floorForm").validate({
					submitHandler: function(form){
						var floorid =$("#floorid").val();
						if($("#floorid").val() ==''||$("#floorid").val()==null){
							top.$.jBox.tip('请选择楼层', 'warning');
							return;
						}
						
						$.get(Com_Parameter.ContextPath + '/sys/base/floorAtt/ckeckAttFloor?floorid='+floorid, function(data) {
							var jsonObj = eval('(' + data + ')');
							
							if(jsonObj==false){
								top.$.jBox.tip('这个楼层已创建附件', 'warning');
								return;
							}
						});
						
						Oosp_Loading('正在提交，请稍等...');
						form.submit();
					},
					errorContainer: "#messageBox",
					errorPlacement: function(error, element) {
						$("#messageBox").text("输入有误，请先更正。");
						if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
							error.appendTo(element.parent().parent());
						} else {
							error.insertAfter(element);
						}
					}
				});

				
	});
</script>
</head>
<body>

<div class="container-fluid">
		<div class="row">
			<div class="col-xs-12">
				<div class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title">
							楼层图 <a class="btn btn-default btn-sm pull-right" role="button"
								href="javascript:void(0)" onclick="history.go(-1)">返回</a>
						</h3>
					</div>

							 <form:form id="floorForm" modelAttribute="sysBaseFloorAttment" action="${contextPath}/sys/base/floorAtt/saveAttFloor" method="post" class="form-inline" role="form">
					           	   <form:hidden path="id"/>
								   <tags:message content="${message}"/>
                              <form:hidden path="id" />
                             <table class="table table-bordered">
					 		 <tbody>
                              <tr>
                              	<td class="text-right" style="width: 20%"><strong>楼层:</strong></td>
                              	<td colspan="2">
                              				<div class="input-group col-sm-4">
												<input type="hidden" name="floorid"  id="floorid" value="${sysBaseFloorAttment.baseFloor.id}"  />
												<input type="text" class="form-control" value="${sysBaseFloorAttment.baseFloor.name}" id="floorName" 
													readonly="readonly"> <span class="input-group-btn">
													<button class="btn btn-primary" id="floorDialog"
														type="button">选择</button>
												</span>
											</div>
								</td>
							</tr>
							 <tr>
							 
							 	<td class="text-right" style="width: 20%"><strong>创建人:</strong></td>
							 	 
                             	 <td colspan="2">     
                             			 ${createByName}   
                             		 <input type="hidden" class="form-control" id="createBy" readonly="readonly" name="createBy" value="${sysBaseFloorAttment.createBy}">
                              	 </td>
                             </tr>
                             <tr>
                             <td class="text-right" style="width: 20%"><strong>创建时间：</strong></td>
                             	<td>
                             	<div class="col-sm-4">
                             	  <input type="text" readonly="readonly"  name="createTime" class="form-control" value="<fmt:formatDate value="${sysBaseFloorAttment.createTime}" type="both" pattern="yyyy-MM-dd"/>" />
                              	 </div>
                             	</td>
                             </tr>
                             
                             
                              <tr>
                             <td class="text-right" style="width: 20%"><strong>修改人：</strong></td>
                             	<td>
                             	<div class="col-sm-4">
                             		 ${updateByName}   
                             		 
                             		  <input type="hidden" class="form-control" id="updateBy" readonly="readonly" name="updateBy" value="${sysBaseFloorAttment.createBy}">
                              	 </div>
                             	</td>
                             </tr>
                              <tr>
                             <td class="text-right" style="width: 20%"><strong>修改时间：</strong></td>
                             	<td>
                             	<div class="col-sm-4">
                             	  <input type="text" readonly="readonly" id="updateTime" name="updateTime"  class="form-control" value="<fmt:formatDate value="${sysBaseFloorAttment.updateTime}" type="both" pattern="yyyy-MM-dd"/>" />
                              	 </div>
                             	</td>
                             </tr>
							<tr>
							 <td class="text-right" style="width: 20%"><strong>楼层图：</strong></td>
								<td>
									<att:upload maxFileSize="2048222" modleName="com.maoye.ossp.sys.base.entity.SysBaseFloorAttment" key="floor" soureBillID="${sysBaseFloorAttment.id}"></att:upload>
								</td>
							</tr>
							<tr>
							
							<td>
								
								<div class="form-group">
									<div class="col-sm-offset-6 col-sm-10">
										<input class="btn btn-primary" type="submit" value="保 存" />
									</div>
								</div>
							</td>
							</tr>
							</tbody>
								</table>
									
                              </form:form>
						</div>
					</div>
				</div>
			</div>
	
</body>
</html>